package com.ahaoyou.listener;

public class ListenerTest {
    public static void main(String[] args) {
        EventPublisherProvider provider = new EventPublisherProvider();
        CatListener catListener = new CatListener();
        DogListener dogListener = new DogListener();
        provider.addListener(catListener);
        provider.addListener(dogListener);
        provider.publishEvent(new DogEvent("dog"));
        provider.publishEvent(new MyDogEvent("myDog"));
        provider.publishEvent(new CatEvent("cat"));
//        DogListener dogListener = new DogListener();
//        ResolvableType resolvableType = ResolvableType.forClass(dogListener.getClass());
//        ResolvableType as = resolvableType.as(Listener.class).getGeneric();
//        CatEvent dog = new CatEvent("dog");
//        ResolvableType dogRe = ResolvableType.forClass(Event.class);
//        System.out.println(dogRe.isAssignableFrom(as));
    }
}
